<div id="pageoptions">
    <% 
    @links = ""
    if @story && !params[:relationship_id] then 
        @links += link_to "< back to story word list", {# link_to options
                    :controller => 'word',
                    :action => 'story_words',
                    :story_id => @story.id } 
    end
    
    if params[:group_id] then
        @links += link_to "< back to group word list", {# link_to options
                    :controller => 'word',
                    :action => 'group_words',
                    :group_id => params[:group_id] }
    end
    if params[:shared] == true then
        @links += link_to "< back to shared word list", {# link_to options
                    :controller => 'word',
                    :action => 'shared_words'}
    end
    if params[:relationship_id] then 
        @links += link_to "< back to #{@owner.first_name} #{@owner.last_name}'s shared word list", {# link_to options
                    :controller => 'word',
                    :action => 'shared_words',
                    :relationship_id => params[:relationship_id]}
    end
        
    %>
    
    <%= @links %>
</div>
<div class="sectionwrap">
    <% if @story then %>
    <div class="sectiontitle">
        Word from <%= link_to "#{@story.title}", {# link_to options
                                :controller => 'story',
                                :action => 'view',
                                :id => @story.id,
                                :relationship_id => params[:relationship_id] } %></div>
    <div class="storydates">Created: <%= h(@story.created_at.strftime(" %m/%d/%Y %I:%M%p")) %>  <%= if @story.updated_at then 
                                                                                                                "Modified: #{h(@story.updated_at.strftime(' %m/%d/%Y %I:%M%p'))}"
                                                                                                            end %></div>                                                                                                          
    <% end %>
        <div id="onewordwrap">
            <span class="oneword"><%= @word[:word] %></span>
            <p>
            <% if @word[:story_id] then%>
                <%= link_to "edit", {# link_to options
                                        :controller => 'word',
                                        :action => 'edit',
                                        :group_id => @word[:group_id],
                                        :story_id => @word[:story_id],
                                        :id => @word[:id]},
                                        {:class => "optionlink"
                                        }  %>
                <%= " | " %>
            <% end %>
            <%= link_to "stories (#{@story_count})", {# link_to options
                                        :controller => 'story',
                                        :action => 'word_stories',
                                        :group_id => @word[:group_id],
                                        :story_id => @word[:story_id],
                                        :id => @word[:id]},
                                        {:class => "optionlink"
                                        }  %>
                <%= " | " %>
            <%= link_to "exclude", {# link_to options
                                    :controller => 'dud',
                                    :action => 'exclude_word',
                                    :group_id => @word[:group_id],
                                    :story_id => @word[:story_id],
                                    :relationship_id => params[:relationship_id],
                                    :shared => params[:shared],
                                    :id => @word[:id]},
                                    {:class => "optionlink"
                                    }  %> 
            </p>
        </div>
</div>